package cn.asiontang.exception;

public class DebugInfoBuilder
{
    private final StringBuilder strDebugInfo = new StringBuilder();

    public DebugInfoBuilder()
    {
    }

    public void append(final Object... objs)
    {
        for (final Object obj : objs)
            this.strDebugInfo.append(obj);
    }

    public void close()
    {
        try
        {
            this.strDebugInfo.delete(0, this.strDebugInfo.length());
            this.strDebugInfo.trimToSize();
        } catch (final Exception e)
        {
            LogEx.e(this.getClass().getName(), e);
        }
    }

    @Override
    public String toString()
    {
        return this.strDebugInfo.toString();
    }
}